<!DOCTYPE html>
<html>
<head>
    <title>原料报溢</title>
    {% include 'system/common/header.html' %}
    <link rel="stylesheet" href="{{ url_for('static', filename='system/admin/css/other/user.css') }}"/>
</head>
<body class="pear-container">
{# 查询表单 #}

<div class="layui-card">
    <div class="layui-card-body">
        <form class="layui-form" action="" lay-filter="user-query-form">
            <div class="layui-form-item">
                <label class="layui-form-label">品名</label>
                <div class="layui-input-inline">
                    <input type="text" name="品名" placeholder="" class="layui-input"  value="{{ info.searchtext }}">
                </div>



                <button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="user-query">
                    <i class="layui-icon layui-icon-search"></i>
                    查询
                </button>
                <button type="reset" class="pear-btn pear-btn-md">
                    <i class="layui-icon layui-icon-refresh"></i>
                    重置
                </button>
            </div>


        <div class="layui-card-body">
            <table class="layui-hide" id="user-table" lay-filter="user-table"></table>
        </div>
            <div class="bottom">
     <div class="button-container">
            <button type="submit" class="pear-btn pear-btn-primary pear-btn-sm"  lay-submit="" lay-filter="user-save" id="user-save">
                <i class="layui-icon layui-icon-ok"></i>
                确认
            </button>

        </div>
    </div>
             </form>
    </div>
</div>


</body>




{% raw %}

<script type="text/html" id="dict-type-enable">
    <input type="checkbox" value="{{ d.id }}" lay-skin="switch" lay-text="启用|禁用" lay-filter="dict-type-enable"
            {{ "{{# if(d.状态==1){ }} checked {{# } }}" }}>

</script>
<script type="text/html" id="user-createTime">
    {{layui.util.toDateString(d.有效期至,  "yyyy-MM-dd")}}
</script>


{% endraw %}

{% include 'system/common/footer.html' %}

<script>
    layui.use(['table', 'form', 'jquery', 'popup', 'common'], function () {
        let table = layui.table
        let form = layui.form
        let $ = layui.jquery

        let popup = layui.popup
        let common = layui.common

        let MODULE_PATH = "/store/raw/excess/yp/"
        // 表格数据
        let cols = [
            [

                {type: 'radio', title: '😊', fixed: true}, // 单选框
                {title: '品名', field: '品名', align: 'center'},
                {title: '简拼', field: '简拼', align: 'center'},
                {title: '规格', field: '规格', align: 'center'},
                {title: '批号', field: '批号', align: 'center'},
                {title: '产地', field: '产地', align: 'center'},
                {title: '库存量', field: '报溢数量', align: 'center'},
                {title: '单位', field: '单位', align: 'center'},
                {title: '货位名称', field: 'location_name', align: 'center'},





            ]
        ]

        // 渲染表格数据
        table.render({
            elem: '#user-table',
            id:'user-table',
            url: MODULE_PATH + 'searchdata',
            page: true,
            cols: cols,
            skin: 'line',
            height: 'full',

            text: {none: '暂无产品信息'},

        })



        //
        form.on('submit(user-save)', function (data) {

            var id='user-table'
            {#var getData = table.getData(id);#}
            {#alert(JSON.stringify(getData))#}
            var checkStatus = table.checkStatus(id);
            {#alert(JSON.stringify(checkStatus))#}
            {#parent.layui.$('#ID_remark').val('我被改变了');#}
            parent.child_table_data=checkStatus


            parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页

            return false
        })
        form.on('submit(user-query)', function (data) {
            window.refresh(data.field)
            return false
        })

        window.refresh = function (param) {
            table.reload('user-table', {where: param})
        }











    })
</script>
</html>